<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/12/2
 * Time: 9:17
 */

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class SysModel extends Model
{
    protected $table = 'think_user';
    protected $primaryKey = "id";
    public $timestamps = false;//关闭laravel自带更新created_at,updated_at,deleted_at的操作


    public function getAdmin($username)
    {
        $res = SysModel::where(['username'=>$username])
            ->select("id","username","passwords")
            ->get()->toArray();
        if($res==null)
        {
            return false;
        }else{
            return $res[0];
        }

    }
}